//
//  RSWRESTService+InnerNews.m
//  RSW.IOS
//
//  Created by zhaiqiuqiu on 17/1/16.
//  Copyright © 2017年 com.xtion.crm. All rights reserved.
//

#import "RSWRESTService+InnerNews.h"

@implementation RSWRESTService (InnerNews)

-(XLGResult*)getInnerNewsSearch:(NSString*) search column:(NSString*)column token:(NSString*)token  pageIndex:(NSInteger)pageIndex pageSize:(NSInteger)pageSize
{
    NSString *URI = [NSString stringWithFormat:@"api/information?search=%@&size=%ld&column=%@&page=%ld&token=%@",search,(long)pageSize, column, (long)pageIndex, token];
    
    XLGResult *r = [self HTTPRESTRequestURI:URI dicData:nil HTTPMethod:XLGHTTPMethodTypeGet];
    
    if(r.outResult == YES)
    {
        NSArray *list = r.outObj[@"List"];
        
        XMSQueueDictionary *qdSet = [InnerNewsList JSONObjectProperty:nil];
        
        list = [CTransformHTTPRESTObj JSONObjs:list transformToProtocolObj:[InnerNewsList class] accordingToColPropertyPair:qdSet];
        
        r = [XLGResult resultWithOutResult:YES outObj:list];
    }
    return r;
}
@end
